Many devices include loudspeakers, which are used to play sounds to a user of the device, based on an input signal. For example, the input signal may be derived from a signal that has been received by the device over a communications link, in the case of a phone call or the like, or may be derived from stored data, in the case of music or speech playback. In many situations, it is desirable to ensure that the signal that is applied to the loudspeaker does not cause damage to the loudspeaker. Thus loudspeaker protection circuitry is commonly used.
It is also known to use the loudspeaker of a device such as a smartphone to produce ultrasonic sounds, for example so that any reflected ultrasonic signal can be used for detecting whether the device is in close proximity to another body.
It is known to provide the loudspeaker protection functionality and ultrasonic pulse generation circuitry in a processor device, and to generate a signal that is then passed to a separate loudspeaker driver circuit.